/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.sql.*;
/**
 *
 * @author amine.tayaa
 */
public class SqlConnect {
        
    public static Connection connectMysql(){
		
		//String url="jdbc:mysql://localhost/mysqldb?user=root&password=";
		
	    	try {
				Class.forName("com.mysql.jdbc.Driver");
			} catch (ClassNotFoundException e) {
				System.out.println("impossible de charger le pilote");
			}

			try {
				return DriverManager.getConnection("jdbc:mysql://localhost/Projet","root","");
			} catch (SQLException e) {
                               System.out.println(e.getMessage());
				System.out.println("url ou user invalide");
				return null;
			}

		
	}

                    
}
   